package demo;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 */
class Arr1{
    public <E extends Comparable<E>> E findMax(E[] array){
        E max = array[0];
        for (int i = 1; i < array.length; i++) {
            if(max.compareTo(array[i])<0){
                max = array[i];
            }
        }
        return max;
    }
}
public class Test1 {
    public static void main(String[] args) {
        Integer[] array = {1,2,3,4,5,6};
        Arr1 arr1 = new Arr1();
        int max = arr1.findMax(array);
        /*int max = arr1.<Integer>findMax(array);*/
        System.out.println(max);
    }
}
